import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:dk_flutter_base/dk_ui.dart';
import 'package:flutter_dk_form/flutter_dk_form.dart';

class PageToastDemoWidget extends StatefulWidget {
  static const String routeName = '/page/toast_demo_page';
  static const String name = "Toast Demo";
  final btnData = ['Toast'];

  @override
  State<StatefulWidget> createState() {
    return _PageToastDemoWidgetState();
  }
}

class _PageToastDemoWidgetState extends State<PageToastDemoWidget> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text("Toast Demo")),
      body: ListView.builder(
          itemCount: widget.btnData.length,
          itemBuilder: (context, index) {
            return InkWell(
              onTap: () {
                if (index == 0) {
                  showDkToast("测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试showDkToast");
                }
              },
              child: new Card(
                child: new Container(
                  alignment: Alignment.centerLeft,
                  margin: EdgeInsets.symmetric(horizontal: 10),
                  height: 50,
                  child: new Text(widget.btnData[index]),
                ),
              ),
            );
          }),
    );
  }

}
